.md-card{
    display: flex;
    flex-direction: column;
    font-size: .875rem;
    position: relative;
    width: 100%;
    margin: 30px 0;
    overflow: unset;

    @include box-shadow($bmd-shadow-2dp);
    border-radius: $border-radius-base + 3;
    color: $mdb-card-body-text;
    background: $mdb-card-body-background;

    &.row-space{
      .header{
        padding: 15px 20px 0;
      }
    }

    .card-title {
      margin-top: .625rem;
    }

    .card-category-social {
      .fa,
      .fas,
      .fab,
      .far,
      .md-icon {
        font-size: 24px;
        position: relative;
        margin-top: -4px;
        top: 2px;
        margin-right: 5px;
      }

      .md-icon {
        margin-top: -7px;
        color: inherit;
      }
    }

    .card-title:last-child {
      margin-bottom: 0;
    }

    &[class*=bg-] .author a,
    &[class*=bg-] .card-category:not([class*="text-"]),
    &[class*=bg-] .card-description,
    &[class*=bg-] .stats .md-icon:not(.md-icon-button),
    &[class*=bg-] .stats,
    &[class*=bg-] .card-title small,
    & [class*=md-card-header-] .author a,
    & [class*=md-card-header-] .card-category,
    & [class*=md-card-header-] .card-description,
    & [class*=md-card-header-] .stats {
      color: rgba($white, .8) !important;
    }

    &[class*=bg-] .card-title,
    &[class*=bg-] .icon:not([class*="icon-"]) i,
    &[class*=bg-] .card-title a {
      color: $white !important;
    }

    &[class*=bg-] .icon:not([class*="icon-"]) i,
    & [class*=md-card-header-] .icon i {
      border-color: rgba($white, .25) !important;
    }

    &.md-card-form-horizontal {
      .md-field {
        margin: 0;
        padding-top: 0;
      }

      .md-card-content {
        padding-left: 15px;
        padding-right: 15px;
      }

      .md-button {
        margin: 0;
      }
    }

    .title{
        margin-top: 0;
        margin-bottom: 5px;
    }
    .card-image {
        height: 60%;
        position: relative;
        overflow: hidden;

        margin-left: 15px;
        margin-right: 15px;
        margin-top: -30px;
        border-radius: $border-radius-large;

        img {
            width: 100%;
            height: 100%;
            border-radius: $border-radius-large;
            pointer-events: none;
        }
        .card-title {
            position: absolute;
            bottom: 15px;
            left: 15px;
            color: $mdb-card-image-headline;
            font-size: $font-size-h4;
            text-shadow: 0 2px 5px rgba(33, 33, 33, 0.5);
        }
    }

    .category:not([class*="text-"]){
        color: $gray-color;
    }
    .md-card-content{
        padding: .9375rem 1.875rem;
        line-height: inherit;

        .category{
            margin: 0;
        }
    }

    .md-card-header{
        margin: -40px  20px 0;
        border-radius: $border-radius-base;
        padding: 0;
        background-color: $gray-color;

        .title,
        .card-title{
          color: $white-color !important;
        }
        .category{
            margin: 0;
            color: rgba($white-color, .62);
        }

        a{
          color: $white-color !important;
        }

        &.card-chart{
            padding: 0;
            min-height: 160px;

            + .content{
                h4{
                    margin-top: 0;
                }
            }
        }

        .ct-label{
            color: rgba($white-color, .7);
        }
        .ct-grid{
            stroke: rgba(255, 255, 255, 0.2);
        }
        .ct-series-a .ct-point,
        .ct-series-a .ct-line,
        .ct-series-a .ct-bar,
        .ct-series-a .ct-slice-donut{
            stroke: rgba(255,255,255,.8);
        }
        .ct-series-a .ct-slice-pie,
        .ct-series-a .ct-area{
            fill: rgba(255,255,255,.4);
        }

    }

    .md-card-header-image {
      position: relative;
      padding: 0;
      z-index: 1;
      margin-left: 15px;
      margin-right: 15px;
      margin-top: -30px;
      border-radius: $border-radius-large;

      a {
        display: block;
      }

      img {
        width: 100%;
        border-radius: $border-radius-large;
        pointer-events: none;
      }

      &:not([shadow-off="true"]) {
        img {
          @include shadow-big-image();
        }
      }

      .card-title {
        position: absolute;
        bottom: 15px;
        left: 15px;
        color: $white-color !important;
        font-size: $font-size-h4;
        text-shadow: 0 2px 5px rgba(33, 33, 33, 0.5);
      }

      .colored-shadow{
        transform: scale(0.94);
        top: 12px;
        filter: blur(12px);
        position: absolute;
        width: 100%;
        height: 100%;
        background-size: cover;
        z-index: -1;
        transition: opacity .45s;
        opacity: 0;
      }

      &[no-colored-shadow="true"]{
        box-shadow: none;

        .colored-shadow{
            display: none !important;
        }
      }

      &:not([shadow-off="true"])[shadow-normal="true"]{
        @include shadow-big();

        .colored-shadow{
          display: none !important;
        }
      }
    }

    .chart-title{
        position: absolute;;
        top: 25px;
        width: 100%;
        text-align: center;

        h3{
            margin: 0;
            color: $white-color;
        }

        h6{
            margin: 0;
            color: rgba(255,255,255, .4);
        }

    }

    .md-card-actions{
        padding: 0 1.875rem .9375rem;

        .content{
            display: block;
        }

        .author{
            color: $gray-color;
        }
        .stats{
            display: flex;
            align-items: center;
            color: $gray-color;
            margin-right: 3px;
            margin-left: 3px;

            .md-icon.md-theme-default.md-icon-font{
                position: relative;
                top: -1px;
                font-size: 18px !important;
                color: $gray-light;
            }
        }

        h6{
            color: $gray-color;
        }

    }

    img{
        width: 100%;
        height: auto;
    }

    .category{
        .md-icon{
            position: relative;
            top: 6px;
            line-height: 0;
        }
    }

    .category-social{
        .fa{
            font-size: 24px;
            position: relative;
            margin-top: -4px;
            top: 2px;
            margin-right: 5px;
        }
    }

    .author{
        .avatar{
            width: 30px;
            height: 30px;
            overflow: hidden;
            border-radius: 50%;
            margin-right: 5px;
        }

        a{
            color: $black-color;
            text-decoration: none;

            .ripple-container{
                display: none;
            }
        }
    }

    .table{
        margin-bottom: 0;

        tr:first-child td{
            border-top: none;
        }
    }

    [data-background-color="purple"],
    .md-card-header-primary,
    &.bg-primary,
    &.md-card-rotate.bg-primary .back,
    &.md-card-rotate.bg-primary .front,
    .md-tabs.md-primary .md-tabs-navigation{
        background: linear-gradient(60deg, $purple-400, $purple-700);
        @include shadow-big-color($brand-primary);
        background-repeat: no-repeat;
    }

    [data-background-color="blue"],
    .md-card-header-info,
    &.bg-info,
    &.md-card-rotate.bg-info .back,
    &.md-card-rotate.bg-info .front,
    .md-tabs.md-info .md-tabs-navigation{
        background: linear-gradient(60deg, $cyan-400, $cyan-700);
        @include shadow-big-color($brand-info);
        background-repeat: no-repeat;
    }

    [data-background-color="green"],
    .md-card-header-green,
    &.bg-success,
    &.md-card-rotate.bg-success .back,
    &.md-card-rotate.bg-success .front,
    .md-tabs.md-success .md-tabs-navigation{
        background: linear-gradient(60deg, $green-400, $green-700);
        @include shadow-big-color($brand-success);
        background-repeat: no-repeat;
    }

    [data-background-color="orange"],
    .md-card-header-orange,
    &.bg-warning,
    &.md-card-rotate.bg-warning .back,
    &.md-card-rotate.bg-warning .front,
    .md-tabs.md-warning .md-tabs-navigation{
        background: linear-gradient(60deg, $orange-400, $orange-700);
        @include shadow-big-color($brand-warning);
        background-repeat: no-repeat;
    }

    [data-background-color="red"],
    .md-card-header-red,
    &.bg-danger,
    &.md-card-rotate.bg-danger .back,
    &.md-card-rotate.bg-danger .front,
    .md-tabs.md-danger .md-tabs-navigation{
        background: linear-gradient(60deg, $red-400, $red-700);
        @include shadow-big-color($brand-danger);
        background-repeat: no-repeat;
    }

    [data-background-color="rose"],
    .md-card-header-rose,
    &.bg-rose,
    &.md-card-rotate.bg-rose .back,
    &.md-card-rotate.bg-rose .front,
    .md-tabs.md-rose .md-tabs-navigation{
        background: linear-gradient(60deg, $pink-400, $pink-700);
        @include shadow-big-color($brand-rose);
        background-repeat: no-repeat;
    }

    [data-background-color]{
        color: $white-color;

        a{
            color: $white-color;
        }
    }
}

.md-card-stats{
    .title{
        margin: 0;

        small{
          color: $gray-color;
          font-size: 65%;
          line-height: 1;
          font-weight: 400;
        }
    }
    .md-card-header{
        float: left;
        text-align: center;

        i{
            font-size: 36px !important;
            line-height: 56px;
            width: 56px;
            height: 56px;
            color: $white-color !important;
        }
    }
    .md-card-content{
        text-align: right;
        padding-top: 10px;
    }

}

.md-card-blog {
  margin-top: 60px;
}

.card-nav-tabs{
    .header-raised{
        margin-top: -$margin-base * 2;
    }
    .nav-tabs{
        background: transparent;
        padding: 0;
    }
    .nav-tabs-title{
        float: left;
        padding: 10px 10px 10px 0;
        line-height: 24px;
    }
}

.md-card-plain{
    background: transparent !important;
    box-shadow: none !important;

    .md-card-header{
      background-color: transparent !important;
      margin-left: 0;
      margin-right: 0;
    }
    .md-card-content,
    .md-card-actions {
        padding-left: 5px;
        padding-right: 5px;
    }

    .card-image{
        margin: 0;
        border-radius: $border-radius-base;

        img{
            border-radius: $border-radius-base;
        }
    }
}

.md-card-horizontal .md-card-header-image {
  margin-top: 0;
}

.md-card-profile,
.md-card-testimonial{
    margin-top: 30px;

    &:not(.md-card-horizontal) {
      text-align: center;
    }

    .btn-just-icon.btn-raised{
        margin-left: 6px;
        margin-right: 6px;
    }

    .md-card-avatar{
        max-width: 130px;
        max-height: 130px;
        margin: -50px auto 0;
        border-radius: 50%;
        overflow: hidden;

        @include shadow-big();

        & + .md-card-content{
            margin-top: 15px;
        }
    }

    &.md-card-plain{
        .card-avatar{
            margin-top: 0;
        }
    }

    &.flex-direction-row {
      .md-card-content,
      .md-card-avatar {
        margin-top: 0;
      }

      .md-card-content {
        text-align: left;
        margin-left: 15px;
      }
    }
}

.md-card-testimonial {
  .md-card-header {
    background-color: $white-color;
    margin-top: 0;
  }

  .card-description {
    font-style: italic;
    margin-bottom: 35px;
  }

  .md-card-actions {
    display: block;

    .md-card-avatar {
      margin-top: 10px;
      margin-bottom: -60px;
    }
  }

  .md-card-avatar {
    max-width: 100px;
    max-height: 100px;
  }

  .icon {
    margin-top: 30px;

    &.icon-black i {
      color: $mdb-card-body-text;
    }

    .md-icon {
      font-size: 40px !important;
    }
  }
}

.md-card-contact {
  .md-card-header {
    padding: 1rem 15px;
  }
}

.md-card-tabs{
  margin-top: 0;

  .md-list{
    flex-flow: initial;
    padding: 0 15px;
  }

  &.page-subcategories > .md-card-header .title{
    margin-top: 30px !important;
    margin-bottom: 25px !important;
    min-height: 32px;
  }

  .tab-content{
    padding: 20px 0 9px;
  }

  .md-list-item + .md-list-item{
    margin-left: 5px;
  }

  .md-list .md-list-item .md-list-item-button{
    line-height: 24px;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 500;
    min-width: 100px;
    color: $black-color !important;
    transition: all .3s;
    border-radius: 30px;
    padding: 0;

    .md-icon{
      display: flex;
      width: auto;
      height: auto;
      margin: 0;
      font-size: 30px !important;
      padding: 15px 0;
      color: $navbar-color;
    }

    .md-list-item-content{
      min-height: auto;
      padding: 10px 15px;
      justify-content: center;
      display: flex;
    }

    &:hover,
    &:focus{
      background-color: rgba(199, 199, 199, .2) !important;
    }
  }

  .md-list .md-list-item:not(.active) .md-list-item-button .md-list-item-content {
    color: $navbar-color;
  }

  .active.md-list-item .md-list-item-button{
    @include tabs-color($gray-color);
    color: $white-color !important;

    .md-list-item-content .md-icon,
    &{
      color: $white-color !important;
    }
  }

  .active.md-list-item.md-rose .md-list-item-button{
    @include tabs-color($brand-rose);
  }
  .active.md-list-item.md-primary .md-list-item-button{
    @include tabs-color($brand-primary);
  }
  .active.md-list-item.md-warning .md-list-item-button{
    @include tabs-color($brand-warning);
  }
  .active.md-list-item.md-info .md-list-item-button{
    @include tabs-color($brand-info);
  }
  .active.md-list-item.md-success .md-list-item-button{
    @include tabs-color($brand-success);
  }
  .active.md-list-item.md-danger .md-list-item-button{
    @include tabs-color($brand-danger);
  }

  &.md-card-plain {

    .md-card-header,
    .md-list{
      background-color: transparent !important;
    }

    .title{
      justify-content: center;
    }
  }
}

.flex-column{
  .md-card-content{
    display: flex;
    flex-flow: initial;
  }

  .md-list{
    flex-direction: column;
    min-width: 148px;

    & .md-list-item + .md-list-item{
      margin: 0;
      margin-top: 5px;
    }
  }

  .tab-content{
    padding: 0;
    padding-left: 30px;
  }
}

.nav-pills-icons{
  .md-list .md-list-item .md-list-item-button {
    border-radius: 4px;

    .md-list-item-content{
      flex-direction: column-reverse;
    }
  }
}

.md-card-login{
  margin: 0 auto;

  .md-button{
    margin: .3125rem 1px;
  }

  .social-line {
    margin-top: 1rem;
    padding: 0;
  }

  .md-card-header,
  .description{
    text-align: center;
  }

  &.md-card-hidden{
    opacity: 0;
    transform: translate3d(0,-60px,0);
  }

  .md-card-header {
    padding: 1rem 15px;
  }

  .md-card-content{
    padding-top: 0;
  }

  .description{
    margin-top: 15px;
  }

  .md-card-actions{
    border: 0;
    justify-content: center;
    width: 100%;
  }
}

.team-player .md-card-actions {
  border: 0;
}

.md-card-blogpost {
  margin-top: 60px;

  .md-card-header-image {
    margin: 0 !important;
  }

  .md-card-content {
    padding: 0;
  }

  .md-layout{
    .card-category{
      margin-bottom: 0;
    }
  }
}

%common-card-background {
  background-position: 50%;
  background-size: cover;
  text-align: center;

  .card-description,
  .card-category,
  small {
    color: rgba($white, .7) !important;
  }

  .card-title {
    color: $white !important;
    margin-top: 10px;
  }

  .md-card-content {
    position: relative;
    z-index: 2;
    padding-top: 40px;
    padding-bottom: 40px;
    margin: 0 auto;
  }

  &::after {
    position: absolute;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: block;
    left: 0;
    top: 0;
    content: "";
    background-color: rgba(0,0,0,.56);
    border-radius: 6px;
  }
}

.md-card-background{
  @extend %common-card-background;

  &:not(.md-card-rotate) .md-card-content {
    min-height: 280px;
    max-width: 440px;
    margin: 0 auto !important;
  }
}

.md-card-pricing {
  text-align: center;

  &:after{
    background-color: rgba(0, 0, 0, 0.7) !important;
  }

  h1{
    small{
      font-size: 18px;
      display: inline-flex;
      height: 0;

      &:first-child{
        position: relative;
        top: -17px;
        font-size: 26px;
      }
    }
  }

  .md-card-content {
    padding: 15px!important;
    margin: 0!important;
  }

  ul{
    list-style: none;
    padding: 0;
    max-width: 240px;
    margin: 10px auto;

    li{
      color: $gray-color;
      text-align: center;
      padding: 12px 0;
      border-bottom: 1px solid rgba($gray-color,.3);

      &:last-child{
        border: 0;
      }
      b{
        color: $black-color;
      }
      .md-icon ,
      i{
        top: -1px;
        position: relative;
      }
    }
  }

  &.md-card-background,
  &[class*="bg-"]{
    ul{
      li{
        color: $white-color;
        border-color: rgba($white-color,.3);

        b{
          color: $white-color;
          font-weight: 700;
        }
      }
    }
    [class*="text-"],
    .card-category{
      color: $white-color !important;
    }
  }

  .icon {
    padding: 10px 0 0;
  }

  .card-title {
    margin-top: 30px;
  }

  .icon i {
    font-size: 55px;
    border: 1px solid #e5e5e5;
    border-radius: 50%;
    width: 130px;
    line-height: 130px;
    height: 130px;
  }

}

.md-card-product {
  font-size: 18px;

  .price-container {
    display: inline-flex;

    .price {
      color: #9a9a9a;
    }

    .price-old {
      text-decoration: line-through;
      font-size: 16px;
      color: #9a9a9a;
    }

    .price-new {
      color: $brand-rose;
    }
  }
}

.md-card-refine {
  .card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .md-collapse-content {
    max-height: 273px;
    overflow-y: scroll;
    overflow-x: hidden;
  }

  .price-left,
  .price-right {
    font-weight: 500;
  }

  .price-content {
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
  }
}

.rotating-card-container{
    @include perspective(800px);

    .md-card-rotate{
      background: transparent;
      box-shadow: none;

      &:after{
        display: none;
      }
    }

    .md-card {
      @include transitions(.8s,$transition-bezier-rotating-card);
      @include transform-style(preserve-3d);
      position: relative;

      .back, .front {
        @include backface-visibility(hidden);
        @include shadow-2dp();
        position: absolute;
        background-color: $white-color;
        border-radius: $border-radius-large;
        top: 0;
        left: 0;
        justify-content:center;
        align-content:center;
        display: flex;
        flex-direction: column;

        .md-card-body{
          justify-content:center;
          align-content:center;
          display: flex;
          flex-direction: column;
        }
      }

      .front {
        z-index: 2;
        position: relative;
      }

      .back {
        @include rotateY-180();
        z-index: 5;
        text-align: center;

        width: 100%;
        height: 100%;

        &.back-background{
          &:after{
            position: absolute;
            z-index: 1;
            width: 100%;
            height: 100%;
            display: block;
            left: 0;
            top: 0;
            content: "";
            background-color: rgba(0,0,0,.56);
            border-radius: $border-radius-large;
          }
        }
        .md-card-footer{
          .md-button{
            margin: 0;
          }
        }

        .md-card-body{
          padding-left: 15px;
          padding-right: 15px;
        }
      }
    }

    &:not(.manual-flip):hover{
      .md-card{
        @include rotateY-180();
      }
    }


    &.hover.manual-flip{
      .md-card{
        @include rotateY-180();
      }
    }

    .md-card-profile &{
      .front{
        text-align: left;
      }
    }
}

// .md-card-profile {
//   &.flex-direction-row {
//     .md-card-content {
//       margin-top: 0;
//     }
//   }
// }

.back-background{
  .md-card-body{
    min-height: auto;
    padding-top: 15px;
    padding-bottom: 15px;
  }
}

.back-background,
.front-background{
  @extend %common-card-background;
}


/*       Fix bug for IE      */

@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
  .rotating-card-container .md-card .front,
  .rotating-card-container .md-card .back{
    backface-visibility: visible;
  }

  .rotating-card-container .md-card .back {
    visibility: hidden;
    transition: visibility .3s cubic-bezier(0.34, 1.45, 0.7, 1);
  }
  .rotating-card-container .md-card .front{
    z-index: 4;
  }

  .rotating-card-container:not(.manual-flip):hover .md-card .back,
  .rotating-card-container.manual-flip.hover .md-card .back{
    z-index: 5;
    visibility: visible;
  }
}
